#! /usr/bin/python3.3

from mathtex.fonts import UnicodeFonts
from mathtex.mathtex_main import Mathtex


def latex2png(expression, filename, **options):
    """
    render a latex expression to a png file
    """
    u = UnicodeFonts(rm="times new roman",it='times new roman:italic',bf='times new roman:bold')
    
    m = Mathtex(expression, dpi=300)
    m.save(filename, 'png')

